﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using BesAsm.MasterData.Entities;
using BesAsm.MasterData.Data;

#endregion

namespace BesAsm.MasterData.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="SscProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class SscProviderBaseCore : EntityProviderBase<BesAsm.MasterData.Entities.Ssc, BesAsm.MasterData.Entities.SscKey>
	{		
		#region Get from Many To Many Relationship Functions
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, BesAsm.MasterData.Entities.SscKey key)
		{
			return Delete(transactionManager, key.SscId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="_sscId">SSC ID. Primary key. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.Int32 _sscId)
		{
			return Delete(null, _sscId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sscId">SSC ID. Primary key. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.Int32 _sscId);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_ALT key.
		///		FK_SSCS_NODES_ALT Description: 
		/// </summary>
		/// <param name="_altTraceNodeId">Alternate draining node id for both existing and future conditions. Commonly used for sumped subcatchments that still need to be traced into models, and indicates where the subatchment would have drained if the sump were not built.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByAltTraceNodeId(System.Int32? _altTraceNodeId)
		{
			int count = -1;
			return GetByAltTraceNodeId(_altTraceNodeId, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_ALT key.
		///		FK_SSCS_NODES_ALT Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_altTraceNodeId">Alternate draining node id for both existing and future conditions. Commonly used for sumped subcatchments that still need to be traced into models, and indicates where the subatchment would have drained if the sump were not built.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		/// <remarks></remarks>
		public TList<Ssc> GetByAltTraceNodeId(TransactionManager transactionManager, System.Int32? _altTraceNodeId)
		{
			int count = -1;
			return GetByAltTraceNodeId(transactionManager, _altTraceNodeId, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_ALT key.
		///		FK_SSCS_NODES_ALT Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_altTraceNodeId">Alternate draining node id for both existing and future conditions. Commonly used for sumped subcatchments that still need to be traced into models, and indicates where the subatchment would have drained if the sump were not built.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByAltTraceNodeId(TransactionManager transactionManager, System.Int32? _altTraceNodeId, int start, int pageLength)
		{
			int count = -1;
			return GetByAltTraceNodeId(transactionManager, _altTraceNodeId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_ALT key.
		///		fkSscsNodesAlt Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_altTraceNodeId">Alternate draining node id for both existing and future conditions. Commonly used for sumped subcatchments that still need to be traced into models, and indicates where the subatchment would have drained if the sump were not built.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByAltTraceNodeId(System.Int32? _altTraceNodeId, int start, int pageLength)
		{
			int count =  -1;
			return GetByAltTraceNodeId(null, _altTraceNodeId, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_ALT key.
		///		fkSscsNodesAlt Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_altTraceNodeId">Alternate draining node id for both existing and future conditions. Commonly used for sumped subcatchments that still need to be traced into models, and indicates where the subatchment would have drained if the sump were not built.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByAltTraceNodeId(System.Int32? _altTraceNodeId, int start, int pageLength,out int count)
		{
			return GetByAltTraceNodeId(null, _altTraceNodeId, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_ALT key.
		///		FK_SSCS_NODES_ALT Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_altTraceNodeId">Alternate draining node id for both existing and future conditions. Commonly used for sumped subcatchments that still need to be traced into models, and indicates where the subatchment would have drained if the sump were not built.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public abstract TList<Ssc> GetByAltTraceNodeId(TransactionManager transactionManager, System.Int32? _altTraceNodeId, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_EX key.
		///		FK_SSCS_NODES_EX Description: 
		/// </summary>
		/// <param name="_nodeIdEx">Draining node for existing conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByNodeIdEx(System.Int32 _nodeIdEx)
		{
			int count = -1;
			return GetByNodeIdEx(_nodeIdEx, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_EX key.
		///		FK_SSCS_NODES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_nodeIdEx">Draining node for existing conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		/// <remarks></remarks>
		public TList<Ssc> GetByNodeIdEx(TransactionManager transactionManager, System.Int32 _nodeIdEx)
		{
			int count = -1;
			return GetByNodeIdEx(transactionManager, _nodeIdEx, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_EX key.
		///		FK_SSCS_NODES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_nodeIdEx">Draining node for existing conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByNodeIdEx(TransactionManager transactionManager, System.Int32 _nodeIdEx, int start, int pageLength)
		{
			int count = -1;
			return GetByNodeIdEx(transactionManager, _nodeIdEx, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_EX key.
		///		fkSscsNodesEx Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_nodeIdEx">Draining node for existing conditions</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByNodeIdEx(System.Int32 _nodeIdEx, int start, int pageLength)
		{
			int count =  -1;
			return GetByNodeIdEx(null, _nodeIdEx, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_EX key.
		///		fkSscsNodesEx Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_nodeIdEx">Draining node for existing conditions</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByNodeIdEx(System.Int32 _nodeIdEx, int start, int pageLength,out int count)
		{
			return GetByNodeIdEx(null, _nodeIdEx, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_EX key.
		///		FK_SSCS_NODES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_nodeIdEx">Draining node for existing conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public abstract TList<Ssc> GetByNodeIdEx(TransactionManager transactionManager, System.Int32 _nodeIdEx, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_FU key.
		///		FK_SSCS_NODES_FU Description: 
		/// </summary>
		/// <param name="_nodeIdFu">Draining node for future conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByNodeIdFu(System.Int32 _nodeIdFu)
		{
			int count = -1;
			return GetByNodeIdFu(_nodeIdFu, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_FU key.
		///		FK_SSCS_NODES_FU Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_nodeIdFu">Draining node for future conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		/// <remarks></remarks>
		public TList<Ssc> GetByNodeIdFu(TransactionManager transactionManager, System.Int32 _nodeIdFu)
		{
			int count = -1;
			return GetByNodeIdFu(transactionManager, _nodeIdFu, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_FU key.
		///		FK_SSCS_NODES_FU Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_nodeIdFu">Draining node for future conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByNodeIdFu(TransactionManager transactionManager, System.Int32 _nodeIdFu, int start, int pageLength)
		{
			int count = -1;
			return GetByNodeIdFu(transactionManager, _nodeIdFu, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_FU key.
		///		fkSscsNodesFu Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_nodeIdFu">Draining node for future conditions</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByNodeIdFu(System.Int32 _nodeIdFu, int start, int pageLength)
		{
			int count =  -1;
			return GetByNodeIdFu(null, _nodeIdFu, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_FU key.
		///		fkSscsNodesFu Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_nodeIdFu">Draining node for future conditions</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByNodeIdFu(System.Int32 _nodeIdFu, int start, int pageLength,out int count)
		{
			return GetByNodeIdFu(null, _nodeIdFu, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_NODES_FU key.
		///		FK_SSCS_NODES_FU Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_nodeIdFu">Draining node for future conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public abstract TList<Ssc> GetByNodeIdFu(TransactionManager transactionManager, System.Int32 _nodeIdFu, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_STATUSES key.
		///		FK_SSCS_STATUSES Description: 
		/// </summary>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByStatus(System.String _status)
		{
			int count = -1;
			return GetByStatus(_status, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_STATUSES key.
		///		FK_SSCS_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		/// <remarks></remarks>
		public TList<Ssc> GetByStatus(TransactionManager transactionManager, System.String _status)
		{
			int count = -1;
			return GetByStatus(transactionManager, _status, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_STATUSES key.
		///		FK_SSCS_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByStatus(TransactionManager transactionManager, System.String _status, int start, int pageLength)
		{
			int count = -1;
			return GetByStatus(transactionManager, _status, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_STATUSES key.
		///		fkSscsStatuses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByStatus(System.String _status, int start, int pageLength)
		{
			int count =  -1;
			return GetByStatus(null, _status, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_STATUSES key.
		///		fkSscsStatuses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public TList<Ssc> GetByStatus(System.String _status, int start, int pageLength,out int count)
		{
			return GetByStatus(null, _status, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_SSCS_STATUSES key.
		///		FK_SSCS_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Ssc objects.</returns>
		public abstract TList<Ssc> GetByStatus(TransactionManager transactionManager, System.String _status, int start, int pageLength, out int count);
		
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override BesAsm.MasterData.Entities.Ssc Get(TransactionManager transactionManager, BesAsm.MasterData.Entities.SscKey key, int start, int pageLength)
		{
			return GetBySscId(transactionManager, key.SscId, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_SSCS index.
		/// </summary>
		/// <param name="_sscId">SSC ID. Primary key</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public BesAsm.MasterData.Entities.Ssc GetBySscId(System.Int32 _sscId)
		{
			int count = -1;
			return GetBySscId(null,_sscId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_SSCS index.
		/// </summary>
		/// <param name="_sscId">SSC ID. Primary key</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public BesAsm.MasterData.Entities.Ssc GetBySscId(System.Int32 _sscId, int start, int pageLength)
		{
			int count = -1;
			return GetBySscId(null, _sscId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_SSCS index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sscId">SSC ID. Primary key</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public BesAsm.MasterData.Entities.Ssc GetBySscId(TransactionManager transactionManager, System.Int32 _sscId)
		{
			int count = -1;
			return GetBySscId(transactionManager, _sscId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_SSCS index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sscId">SSC ID. Primary key</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public BesAsm.MasterData.Entities.Ssc GetBySscId(TransactionManager transactionManager, System.Int32 _sscId, int start, int pageLength)
		{
			int count = -1;
			return GetBySscId(transactionManager, _sscId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_SSCS index.
		/// </summary>
		/// <param name="_sscId">SSC ID. Primary key</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public BesAsm.MasterData.Entities.Ssc GetBySscId(System.Int32 _sscId, int start, int pageLength, out int count)
		{
			return GetBySscId(null, _sscId, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_SSCS index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sscId">SSC ID. Primary key</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public abstract BesAsm.MasterData.Entities.Ssc GetBySscId(TransactionManager transactionManager, System.Int32 _sscId, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key R138_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public BesAsm.MasterData.Entities.Ssc GetByObjectid(System.Int32 _objectid)
		{
			int count = -1;
			return GetByObjectid(null,_objectid, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R138_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public BesAsm.MasterData.Entities.Ssc GetByObjectid(System.Int32 _objectid, int start, int pageLength)
		{
			int count = -1;
			return GetByObjectid(null, _objectid, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R138_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public BesAsm.MasterData.Entities.Ssc GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid)
		{
			int count = -1;
			return GetByObjectid(transactionManager, _objectid, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R138_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public BesAsm.MasterData.Entities.Ssc GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid, int start, int pageLength)
		{
			int count = -1;
			return GetByObjectid(transactionManager, _objectid, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R138_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public BesAsm.MasterData.Entities.Ssc GetByObjectid(System.Int32 _objectid, int start, int pageLength, out int count)
		{
			return GetByObjectid(null, _objectid, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the R138_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Ssc"/> class.</returns>
		public abstract BesAsm.MasterData.Entities.Ssc GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#region USP_SSCS_RF_GROSS_ACRES_FU 
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_RF_GROSS_ACRES_FU' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet RfGrossAcresFu(System.Object idTable)
		{
			return RfGrossAcresFu(null, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_RF_GROSS_ACRES_FU' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet RfGrossAcresFu(int start, int pageLength, System.Object idTable)
		{
			return RfGrossAcresFu(null, start, pageLength , idTable);
		}
				
		/// <summary>
		///	This method wrap the 'USP_SSCS_RF_GROSS_ACRES_FU' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet RfGrossAcresFu(TransactionManager transactionManager, System.Object idTable)
		{
			return RfGrossAcresFu(transactionManager, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_RF_GROSS_ACRES_FU' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public abstract DataSet RfGrossAcresFu(TransactionManager transactionManager, int start, int pageLength , System.Object idTable);
		
		#endregion
		
		#region USP_SSCS_SELECT_OIDS_BY_NODE_IDS 
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_SELECT_OIDS_BY_NODE_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="timeFrame"> A <c>System.String</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet SelectOidsByNodeIds(System.Object idTable, System.String timeFrame)
		{
			return SelectOidsByNodeIds(null, 0, int.MaxValue , idTable, timeFrame);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_SELECT_OIDS_BY_NODE_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="timeFrame"> A <c>System.String</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet SelectOidsByNodeIds(int start, int pageLength, System.Object idTable, System.String timeFrame)
		{
			return SelectOidsByNodeIds(null, start, pageLength , idTable, timeFrame);
		}
				
		/// <summary>
		///	This method wrap the 'USP_SSCS_SELECT_OIDS_BY_NODE_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="timeFrame"> A <c>System.String</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet SelectOidsByNodeIds(TransactionManager transactionManager, System.Object idTable, System.String timeFrame)
		{
			return SelectOidsByNodeIds(transactionManager, 0, int.MaxValue , idTable, timeFrame);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_SELECT_OIDS_BY_NODE_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="timeFrame"> A <c>System.String</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public abstract DataSet SelectOidsByNodeIds(TransactionManager transactionManager, int start, int pageLength , System.Object idTable, System.String timeFrame);
		
		#endregion
		
		#region USP_SSCS_RF_GROSS_ACRES_EX 
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_RF_GROSS_ACRES_EX' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet RfGrossAcresEx(System.Object idTable)
		{
			return RfGrossAcresEx(null, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_RF_GROSS_ACRES_EX' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet RfGrossAcresEx(int start, int pageLength, System.Object idTable)
		{
			return RfGrossAcresEx(null, start, pageLength , idTable);
		}
				
		/// <summary>
		///	This method wrap the 'USP_SSCS_RF_GROSS_ACRES_EX' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet RfGrossAcresEx(TransactionManager transactionManager, System.Object idTable)
		{
			return RfGrossAcresEx(transactionManager, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_RF_GROSS_ACRES_EX' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public abstract DataSet RfGrossAcresEx(TransactionManager transactionManager, int start, int pageLength , System.Object idTable);
		
		#endregion
		
		#region USP_SSCS_PK_GROSS_ACRES_EX 
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_PK_GROSS_ACRES_EX' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet PkGrossAcresEx(System.Object idTable)
		{
			return PkGrossAcresEx(null, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_PK_GROSS_ACRES_EX' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet PkGrossAcresEx(int start, int pageLength, System.Object idTable)
		{
			return PkGrossAcresEx(null, start, pageLength , idTable);
		}
				
		/// <summary>
		///	This method wrap the 'USP_SSCS_PK_GROSS_ACRES_EX' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet PkGrossAcresEx(TransactionManager transactionManager, System.Object idTable)
		{
			return PkGrossAcresEx(transactionManager, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_PK_GROSS_ACRES_EX' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public abstract DataSet PkGrossAcresEx(TransactionManager transactionManager, int start, int pageLength , System.Object idTable);
		
		#endregion
		
		#region USP_SSCS_SELECT_BY_OIDS 
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;Ssc&gt;"/> instance.</returns>
		public TList<Ssc> SelectByOids(System.Object idTable)
		{
			return SelectByOids(null, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;Ssc&gt;"/> instance.</returns>
		public TList<Ssc> SelectByOids(int start, int pageLength, System.Object idTable)
		{
			return SelectByOids(null, start, pageLength , idTable);
		}
				
		/// <summary>
		///	This method wrap the 'USP_SSCS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;Ssc&gt;"/> instance.</returns>
		public TList<Ssc> SelectByOids(TransactionManager transactionManager, System.Object idTable)
		{
			return SelectByOids(transactionManager, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;Ssc&gt;"/> instance.</returns>
		public abstract TList<Ssc> SelectByOids(TransactionManager transactionManager, int start, int pageLength , System.Object idTable);
		
		#endregion
		
		#region USP_SSCS_PK_GROSS_ACRES_FU 
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_PK_GROSS_ACRES_FU' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet PkGrossAcresFu(System.Object idTable)
		{
			return PkGrossAcresFu(null, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_PK_GROSS_ACRES_FU' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet PkGrossAcresFu(int start, int pageLength, System.Object idTable)
		{
			return PkGrossAcresFu(null, start, pageLength , idTable);
		}
				
		/// <summary>
		///	This method wrap the 'USP_SSCS_PK_GROSS_ACRES_FU' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet PkGrossAcresFu(TransactionManager transactionManager, System.Object idTable)
		{
			return PkGrossAcresFu(transactionManager, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_SSCS_PK_GROSS_ACRES_FU' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public abstract DataSet PkGrossAcresFu(TransactionManager transactionManager, int start, int pageLength , System.Object idTable);
		
		#endregion
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a TList&lt;Ssc&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="TList&lt;Ssc&gt;"/></returns>
		public static TList<Ssc> Fill(IDataReader reader, TList<Ssc> rows, int start, int pageLength)
		{
			NetTiersProvider currentProvider = DataRepository.Provider;
            bool useEntityFactory = currentProvider.UseEntityFactory;
            bool enableEntityTracking = currentProvider.EnableEntityTracking;
            LoadPolicy currentLoadPolicy = currentProvider.CurrentLoadPolicy;
			Type entityCreationFactoryType = currentProvider.EntityCreationalFactoryType;
			
			// advance to the starting row
			for (int i = 0; i < start; i++)
			{
				if (!reader.Read())
				return rows; // not enough rows, just return
			}
			for (int i = 0; i < pageLength; i++)
			{
				if (!reader.Read())
					break; // we are done
					
				string key = null;
				
				BesAsm.MasterData.Entities.Ssc c = null;
				if (useEntityFactory)
				{
					key = new System.Text.StringBuilder("Ssc")
					.Append("|").Append((System.Int32)reader[((int)SscColumn.SscId - 1)]).ToString();
					c = EntityManager.LocateOrCreate<Ssc>(
					key.ToString(), // EntityTrackingKey
					"Ssc",  //Creational Type
					entityCreationFactoryType,  //Factory used to create entity
					enableEntityTracking); // Track this entity?
				}
				else
				{
					c = new BesAsm.MasterData.Entities.Ssc();
				}
				
				if (!enableEntityTracking ||
					c.EntityState == EntityState.Added ||
					(enableEntityTracking &&
					
						(
							(currentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
							(currentLoadPolicy == LoadPolicy.DiscardChanges && c.EntityState != EntityState.Unchanged)
						)
					))
				{
					c.SuppressEntityEvents = true;
					c.Objectid = (System.Int32)reader[((int)SscColumn.Objectid - 1)];
					c.TreeOverPaveAreaAc = (reader.IsDBNull(((int)SscColumn.TreeOverPaveAreaAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.TreeOverPaveAreaAc - 1)];
					c.NeedsUpdate = (reader.IsDBNull(((int)SscColumn.NeedsUpdate - 1)))?null:(System.Int32?)reader[((int)SscColumn.NeedsUpdate - 1)];
					c.SidewalkAreaExAc = (reader.IsDBNull(((int)SscColumn.SidewalkAreaExAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.SidewalkAreaExAc - 1)];
					c.SidewalkAreaOtherExAc = (reader.IsDBNull(((int)SscColumn.SidewalkAreaOtherExAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.SidewalkAreaOtherExAc - 1)];
					c.SidewalkFactor = (reader.IsDBNull(((int)SscColumn.SidewalkFactor - 1)))?null:(System.Decimal?)reader[((int)SscColumn.SidewalkFactor - 1)];
					c.SidewalkAreaFuAc = (reader.IsDBNull(((int)SscColumn.SidewalkAreaFuAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.SidewalkAreaFuAc - 1)];
					c.IsSumpedEx = (reader.IsDBNull(((int)SscColumn.IsSumpedEx - 1)))?null:(System.Int32?)reader[((int)SscColumn.IsSumpedEx - 1)];
					c.IsSumpedFu = (reader.IsDBNull(((int)SscColumn.IsSumpedFu - 1)))?null:(System.Int32?)reader[((int)SscColumn.IsSumpedFu - 1)];
					c.AreaAc = (reader.IsDBNull(((int)SscColumn.AreaAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.AreaAc - 1)];
					c.PavementAreaAc = (reader.IsDBNull(((int)SscColumn.PavementAreaAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.PavementAreaAc - 1)];
					c.RightOfWayAreaFuAc = (reader.IsDBNull(((int)SscColumn.RightOfWayAreaFuAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.RightOfWayAreaFuAc - 1)];
					c.SscId = (System.Int32)reader[((int)SscColumn.SscId - 1)];
					c.OriginalSscId = c.SscId;
					c.RightOfWayAreaOtherFuAc = (reader.IsDBNull(((int)SscColumn.RightOfWayAreaOtherFuAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.RightOfWayAreaOtherFuAc - 1)];
					c.DataSource = (reader.IsDBNull(((int)SscColumn.DataSource - 1)))?null:(System.String)reader[((int)SscColumn.DataSource - 1)];
					c.NodeIdEx = (System.Int32)reader[((int)SscColumn.NodeIdEx - 1)];
					c.NodeIdFu = (System.Int32)reader[((int)SscColumn.NodeIdFu - 1)];
					c.AltTraceNodeId = (reader.IsDBNull(((int)SscColumn.AltTraceNodeId - 1)))?null:(System.Int32?)reader[((int)SscColumn.AltTraceNodeId - 1)];
					c.Slope = (reader.IsDBNull(((int)SscColumn.Slope - 1)))?null:(System.Decimal?)reader[((int)SscColumn.Slope - 1)];
					c.FlowLength = (reader.IsDBNull(((int)SscColumn.FlowLength - 1)))?null:(System.Decimal?)reader[((int)SscColumn.FlowLength - 1)];
					c.ElevationDifference = (reader.IsDBNull(((int)SscColumn.ElevationDifference - 1)))?null:(System.Decimal?)reader[((int)SscColumn.ElevationDifference - 1)];
					c.PerviousRoughness = (reader.IsDBNull(((int)SscColumn.PerviousRoughness - 1)))?null:(System.Decimal?)reader[((int)SscColumn.PerviousRoughness - 1)];
					c.ImperviousRoughness = (reader.IsDBNull(((int)SscColumn.ImperviousRoughness - 1)))?null:(System.Decimal?)reader[((int)SscColumn.ImperviousRoughness - 1)];
					c.ImperviousStorageDepthIn = (reader.IsDBNull(((int)SscColumn.ImperviousStorageDepthIn - 1)))?null:(System.Decimal?)reader[((int)SscColumn.ImperviousStorageDepthIn - 1)];
					c.PerviousStorageDepthIn = (reader.IsDBNull(((int)SscColumn.PerviousStorageDepthIn - 1)))?null:(System.Decimal?)reader[((int)SscColumn.PerviousStorageDepthIn - 1)];
					c.AverageCapillarySuctionIn = (reader.IsDBNull(((int)SscColumn.AverageCapillarySuctionIn - 1)))?null:(System.Decimal?)reader[((int)SscColumn.AverageCapillarySuctionIn - 1)];
					c.SaturHydraulicCondInhr = (reader.IsDBNull(((int)SscColumn.SaturHydraulicCondInhr - 1)))?null:(System.Decimal?)reader[((int)SscColumn.SaturHydraulicCondInhr - 1)];
					c.InitialMoistureDeficit = (reader.IsDBNull(((int)SscColumn.InitialMoistureDeficit - 1)))?null:(System.Decimal?)reader[((int)SscColumn.InitialMoistureDeficit - 1)];
					c.EditedBy = (System.String)reader[((int)SscColumn.EditedBy - 1)];
					c.EditReason = (System.String)reader[((int)SscColumn.EditReason - 1)];
					c.Status = (System.String)reader[((int)SscColumn.Status - 1)];
					c.AppendDate = (System.DateTime)reader[((int)SscColumn.AppendDate - 1)];
					c.EditDate = (reader.IsDBNull(((int)SscColumn.EditDate - 1)))?null:(System.DateTime?)reader[((int)SscColumn.EditDate - 1)];
					c.NodeNameExDeprecated = (reader.IsDBNull(((int)SscColumn.NodeNameExDeprecated - 1)))?null:(System.String)reader[((int)SscColumn.NodeNameExDeprecated - 1)];
					c.NodeNameFuDeprecated = (reader.IsDBNull(((int)SscColumn.NodeNameFuDeprecated - 1)))?null:(System.String)reader[((int)SscColumn.NodeNameFuDeprecated - 1)];
					c.AltTraceNodeNameDeprecated = (reader.IsDBNull(((int)SscColumn.AltTraceNodeNameDeprecated - 1)))?null:(System.String)reader[((int)SscColumn.AltTraceNodeNameDeprecated - 1)];
					c.SurfscidDeprecated = (reader.IsDBNull(((int)SscColumn.SurfscidDeprecated - 1)))?null:(System.Int32?)reader[((int)SscColumn.SurfscidDeprecated - 1)];
					c.Shape = (reader.IsDBNull(((int)SscColumn.Shape - 1)))?null:(System.Object)reader[((int)SscColumn.Shape - 1)];
					c.EntityTrackingKey = key;
					c.AcceptChanges();
					c.SuppressEntityEvents = false;
				}
				rows.Add(c);
			}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="BesAsm.MasterData.Entities.Ssc"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.Ssc"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, BesAsm.MasterData.Entities.Ssc entity)
		{
			if (!reader.Read()) return;
			
			entity.Objectid = (System.Int32)reader[((int)SscColumn.Objectid - 1)];
			entity.TreeOverPaveAreaAc = (reader.IsDBNull(((int)SscColumn.TreeOverPaveAreaAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.TreeOverPaveAreaAc - 1)];
			entity.NeedsUpdate = (reader.IsDBNull(((int)SscColumn.NeedsUpdate - 1)))?null:(System.Int32?)reader[((int)SscColumn.NeedsUpdate - 1)];
			entity.SidewalkAreaExAc = (reader.IsDBNull(((int)SscColumn.SidewalkAreaExAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.SidewalkAreaExAc - 1)];
			entity.SidewalkAreaOtherExAc = (reader.IsDBNull(((int)SscColumn.SidewalkAreaOtherExAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.SidewalkAreaOtherExAc - 1)];
			entity.SidewalkFactor = (reader.IsDBNull(((int)SscColumn.SidewalkFactor - 1)))?null:(System.Decimal?)reader[((int)SscColumn.SidewalkFactor - 1)];
			entity.SidewalkAreaFuAc = (reader.IsDBNull(((int)SscColumn.SidewalkAreaFuAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.SidewalkAreaFuAc - 1)];
			entity.IsSumpedEx = (reader.IsDBNull(((int)SscColumn.IsSumpedEx - 1)))?null:(System.Int32?)reader[((int)SscColumn.IsSumpedEx - 1)];
			entity.IsSumpedFu = (reader.IsDBNull(((int)SscColumn.IsSumpedFu - 1)))?null:(System.Int32?)reader[((int)SscColumn.IsSumpedFu - 1)];
			entity.AreaAc = (reader.IsDBNull(((int)SscColumn.AreaAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.AreaAc - 1)];
			entity.PavementAreaAc = (reader.IsDBNull(((int)SscColumn.PavementAreaAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.PavementAreaAc - 1)];
			entity.RightOfWayAreaFuAc = (reader.IsDBNull(((int)SscColumn.RightOfWayAreaFuAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.RightOfWayAreaFuAc - 1)];
			entity.SscId = (System.Int32)reader[((int)SscColumn.SscId - 1)];
			entity.OriginalSscId = (System.Int32)reader["ssc_id"];
			entity.RightOfWayAreaOtherFuAc = (reader.IsDBNull(((int)SscColumn.RightOfWayAreaOtherFuAc - 1)))?null:(System.Decimal?)reader[((int)SscColumn.RightOfWayAreaOtherFuAc - 1)];
			entity.DataSource = (reader.IsDBNull(((int)SscColumn.DataSource - 1)))?null:(System.String)reader[((int)SscColumn.DataSource - 1)];
			entity.NodeIdEx = (System.Int32)reader[((int)SscColumn.NodeIdEx - 1)];
			entity.NodeIdFu = (System.Int32)reader[((int)SscColumn.NodeIdFu - 1)];
			entity.AltTraceNodeId = (reader.IsDBNull(((int)SscColumn.AltTraceNodeId - 1)))?null:(System.Int32?)reader[((int)SscColumn.AltTraceNodeId - 1)];
			entity.Slope = (reader.IsDBNull(((int)SscColumn.Slope - 1)))?null:(System.Decimal?)reader[((int)SscColumn.Slope - 1)];
			entity.FlowLength = (reader.IsDBNull(((int)SscColumn.FlowLength - 1)))?null:(System.Decimal?)reader[((int)SscColumn.FlowLength - 1)];
			entity.ElevationDifference = (reader.IsDBNull(((int)SscColumn.ElevationDifference - 1)))?null:(System.Decimal?)reader[((int)SscColumn.ElevationDifference - 1)];
			entity.PerviousRoughness = (reader.IsDBNull(((int)SscColumn.PerviousRoughness - 1)))?null:(System.Decimal?)reader[((int)SscColumn.PerviousRoughness - 1)];
			entity.ImperviousRoughness = (reader.IsDBNull(((int)SscColumn.ImperviousRoughness - 1)))?null:(System.Decimal?)reader[((int)SscColumn.ImperviousRoughness - 1)];
			entity.ImperviousStorageDepthIn = (reader.IsDBNull(((int)SscColumn.ImperviousStorageDepthIn - 1)))?null:(System.Decimal?)reader[((int)SscColumn.ImperviousStorageDepthIn - 1)];
			entity.PerviousStorageDepthIn = (reader.IsDBNull(((int)SscColumn.PerviousStorageDepthIn - 1)))?null:(System.Decimal?)reader[((int)SscColumn.PerviousStorageDepthIn - 1)];
			entity.AverageCapillarySuctionIn = (reader.IsDBNull(((int)SscColumn.AverageCapillarySuctionIn - 1)))?null:(System.Decimal?)reader[((int)SscColumn.AverageCapillarySuctionIn - 1)];
			entity.SaturHydraulicCondInhr = (reader.IsDBNull(((int)SscColumn.SaturHydraulicCondInhr - 1)))?null:(System.Decimal?)reader[((int)SscColumn.SaturHydraulicCondInhr - 1)];
			entity.InitialMoistureDeficit = (reader.IsDBNull(((int)SscColumn.InitialMoistureDeficit - 1)))?null:(System.Decimal?)reader[((int)SscColumn.InitialMoistureDeficit - 1)];
			entity.EditedBy = (System.String)reader[((int)SscColumn.EditedBy - 1)];
			entity.EditReason = (System.String)reader[((int)SscColumn.EditReason - 1)];
			entity.Status = (System.String)reader[((int)SscColumn.Status - 1)];
			entity.AppendDate = (System.DateTime)reader[((int)SscColumn.AppendDate - 1)];
			entity.EditDate = (reader.IsDBNull(((int)SscColumn.EditDate - 1)))?null:(System.DateTime?)reader[((int)SscColumn.EditDate - 1)];
			entity.NodeNameExDeprecated = (reader.IsDBNull(((int)SscColumn.NodeNameExDeprecated - 1)))?null:(System.String)reader[((int)SscColumn.NodeNameExDeprecated - 1)];
			entity.NodeNameFuDeprecated = (reader.IsDBNull(((int)SscColumn.NodeNameFuDeprecated - 1)))?null:(System.String)reader[((int)SscColumn.NodeNameFuDeprecated - 1)];
			entity.AltTraceNodeNameDeprecated = (reader.IsDBNull(((int)SscColumn.AltTraceNodeNameDeprecated - 1)))?null:(System.String)reader[((int)SscColumn.AltTraceNodeNameDeprecated - 1)];
			entity.SurfscidDeprecated = (reader.IsDBNull(((int)SscColumn.SurfscidDeprecated - 1)))?null:(System.Int32?)reader[((int)SscColumn.SurfscidDeprecated - 1)];
			entity.Shape = (reader.IsDBNull(((int)SscColumn.Shape - 1)))?null:(System.Object)reader[((int)SscColumn.Shape - 1)];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="BesAsm.MasterData.Entities.Ssc"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.Ssc"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, BesAsm.MasterData.Entities.Ssc entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.Objectid = (System.Int32)dataRow["OBJECTID"];
			entity.TreeOverPaveAreaAc = Convert.IsDBNull(dataRow["tree_over_pave_area_ac"]) ? null : (System.Decimal?)dataRow["tree_over_pave_area_ac"];
			entity.NeedsUpdate = Convert.IsDBNull(dataRow["needs_update"]) ? null : (System.Int32?)dataRow["needs_update"];
			entity.SidewalkAreaExAc = Convert.IsDBNull(dataRow["sidewalk_area_ex_ac"]) ? null : (System.Decimal?)dataRow["sidewalk_area_ex_ac"];
			entity.SidewalkAreaOtherExAc = Convert.IsDBNull(dataRow["sidewalk_area_other_ex_ac"]) ? null : (System.Decimal?)dataRow["sidewalk_area_other_ex_ac"];
			entity.SidewalkFactor = Convert.IsDBNull(dataRow["sidewalk_factor"]) ? null : (System.Decimal?)dataRow["sidewalk_factor"];
			entity.SidewalkAreaFuAc = Convert.IsDBNull(dataRow["sidewalk_area_fu_ac"]) ? null : (System.Decimal?)dataRow["sidewalk_area_fu_ac"];
			entity.IsSumpedEx = Convert.IsDBNull(dataRow["is_sumped_ex"]) ? null : (System.Int32?)dataRow["is_sumped_ex"];
			entity.IsSumpedFu = Convert.IsDBNull(dataRow["is_sumped_fu"]) ? null : (System.Int32?)dataRow["is_sumped_fu"];
			entity.AreaAc = Convert.IsDBNull(dataRow["area_ac"]) ? null : (System.Decimal?)dataRow["area_ac"];
			entity.PavementAreaAc = Convert.IsDBNull(dataRow["pavement_area_ac"]) ? null : (System.Decimal?)dataRow["pavement_area_ac"];
			entity.RightOfWayAreaFuAc = Convert.IsDBNull(dataRow["right_of_way_area_fu_ac"]) ? null : (System.Decimal?)dataRow["right_of_way_area_fu_ac"];
			entity.SscId = (System.Int32)dataRow["ssc_id"];
			entity.OriginalSscId = (System.Int32)dataRow["ssc_id"];
			entity.RightOfWayAreaOtherFuAc = Convert.IsDBNull(dataRow["right_of_way_area_other_fu_ac"]) ? null : (System.Decimal?)dataRow["right_of_way_area_other_fu_ac"];
			entity.DataSource = Convert.IsDBNull(dataRow["data_source"]) ? null : (System.String)dataRow["data_source"];
			entity.NodeIdEx = (System.Int32)dataRow["node_id_ex"];
			entity.NodeIdFu = (System.Int32)dataRow["node_id_fu"];
			entity.AltTraceNodeId = Convert.IsDBNull(dataRow["alt_trace_node_id"]) ? null : (System.Int32?)dataRow["alt_trace_node_id"];
			entity.Slope = Convert.IsDBNull(dataRow["slope"]) ? null : (System.Decimal?)dataRow["slope"];
			entity.FlowLength = Convert.IsDBNull(dataRow["flow_length"]) ? null : (System.Decimal?)dataRow["flow_length"];
			entity.ElevationDifference = Convert.IsDBNull(dataRow["elevation_difference"]) ? null : (System.Decimal?)dataRow["elevation_difference"];
			entity.PerviousRoughness = Convert.IsDBNull(dataRow["pervious_roughness"]) ? null : (System.Decimal?)dataRow["pervious_roughness"];
			entity.ImperviousRoughness = Convert.IsDBNull(dataRow["impervious_roughness"]) ? null : (System.Decimal?)dataRow["impervious_roughness"];
			entity.ImperviousStorageDepthIn = Convert.IsDBNull(dataRow["impervious_storage_depth_in"]) ? null : (System.Decimal?)dataRow["impervious_storage_depth_in"];
			entity.PerviousStorageDepthIn = Convert.IsDBNull(dataRow["pervious_storage_depth_in"]) ? null : (System.Decimal?)dataRow["pervious_storage_depth_in"];
			entity.AverageCapillarySuctionIn = Convert.IsDBNull(dataRow["average_capillary_suction_in"]) ? null : (System.Decimal?)dataRow["average_capillary_suction_in"];
			entity.SaturHydraulicCondInhr = Convert.IsDBNull(dataRow["satur_hydraulic_cond_inhr"]) ? null : (System.Decimal?)dataRow["satur_hydraulic_cond_inhr"];
			entity.InitialMoistureDeficit = Convert.IsDBNull(dataRow["initial_moisture_deficit"]) ? null : (System.Decimal?)dataRow["initial_moisture_deficit"];
			entity.EditedBy = (System.String)dataRow["edited_by"];
			entity.EditReason = (System.String)dataRow["edit_reason"];
			entity.Status = (System.String)dataRow["status"];
			entity.AppendDate = (System.DateTime)dataRow["append_date"];
			entity.EditDate = Convert.IsDBNull(dataRow["edit_date"]) ? null : (System.DateTime?)dataRow["edit_date"];
			entity.NodeNameExDeprecated = Convert.IsDBNull(dataRow["node_name_ex_deprecated"]) ? null : (System.String)dataRow["node_name_ex_deprecated"];
			entity.NodeNameFuDeprecated = Convert.IsDBNull(dataRow["node_name_fu_deprecated"]) ? null : (System.String)dataRow["node_name_fu_deprecated"];
			entity.AltTraceNodeNameDeprecated = Convert.IsDBNull(dataRow["alt_trace_node_name_deprecated"]) ? null : (System.String)dataRow["alt_trace_node_name_deprecated"];
			entity.SurfscidDeprecated = Convert.IsDBNull(dataRow["surfscid_deprecated"]) ? null : (System.Int32?)dataRow["surfscid_deprecated"];
			entity.Shape = Convert.IsDBNull(dataRow["SHAPE"]) ? null : (System.Object)dataRow["SHAPE"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.Ssc"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">BesAsm.MasterData.Entities.Ssc Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		public override void DeepLoad(TransactionManager transactionManager, BesAsm.MasterData.Entities.Ssc entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;

			#region AltTraceNodeIdSource	
			if (CanDeepLoad(entity, "Node|AltTraceNodeIdSource", deepLoadType, innerList) 
				&& entity.AltTraceNodeIdSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.AltTraceNodeId ?? (int)0);
				Node tmpEntity = EntityManager.LocateEntity<Node>(EntityLocator.ConstructKeyFromPkItems(typeof(Node), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.AltTraceNodeIdSource = tmpEntity;
				else
					entity.AltTraceNodeIdSource = DataRepository.NodeProvider.GetByNodeId(transactionManager, (entity.AltTraceNodeId ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'AltTraceNodeIdSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.AltTraceNodeIdSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.NodeProvider.DeepLoad(transactionManager, entity.AltTraceNodeIdSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion AltTraceNodeIdSource

			#region NodeIdExSource	
			if (CanDeepLoad(entity, "Node|NodeIdExSource", deepLoadType, innerList) 
				&& entity.NodeIdExSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.NodeIdEx;
				Node tmpEntity = EntityManager.LocateEntity<Node>(EntityLocator.ConstructKeyFromPkItems(typeof(Node), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.NodeIdExSource = tmpEntity;
				else
					entity.NodeIdExSource = DataRepository.NodeProvider.GetByNodeId(transactionManager, entity.NodeIdEx);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'NodeIdExSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.NodeIdExSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.NodeProvider.DeepLoad(transactionManager, entity.NodeIdExSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion NodeIdExSource

			#region NodeIdFuSource	
			if (CanDeepLoad(entity, "Node|NodeIdFuSource", deepLoadType, innerList) 
				&& entity.NodeIdFuSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.NodeIdFu;
				Node tmpEntity = EntityManager.LocateEntity<Node>(EntityLocator.ConstructKeyFromPkItems(typeof(Node), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.NodeIdFuSource = tmpEntity;
				else
					entity.NodeIdFuSource = DataRepository.NodeProvider.GetByNodeId(transactionManager, entity.NodeIdFu);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'NodeIdFuSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.NodeIdFuSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.NodeProvider.DeepLoad(transactionManager, entity.NodeIdFuSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion NodeIdFuSource

			#region StatusSource	
			if (CanDeepLoad(entity, "Status|StatusSource", deepLoadType, innerList) 
				&& entity.StatusSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.Status;
				Status tmpEntity = EntityManager.LocateEntity<Status>(EntityLocator.ConstructKeyFromPkItems(typeof(Status), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.StatusSource = tmpEntity;
				else
					entity.StatusSource = DataRepository.StatusProvider.GetByStatusId(transactionManager, entity.Status);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'StatusSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.StatusSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.StatusProvider.DeepLoad(transactionManager, entity.StatusSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion StatusSource
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			// Deep load child collections  - Call GetBySscId methods when available
			
			#region IcNodeRedirectorCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<IcNodeRedirector>|IcNodeRedirectorCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IcNodeRedirectorCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.IcNodeRedirectorCollection = DataRepository.IcNodeRedirectorProvider.GetBySscId(transactionManager, entity.SscId);

				if (deep && entity.IcNodeRedirectorCollection.Count > 0)
				{
					deepHandles.Add("IcNodeRedirectorCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<IcNodeRedirector>) DataRepository.IcNodeRedirectorProvider.DeepLoad,
						new object[] { transactionManager, entity.IcNodeRedirectorCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region SscZingerCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<SscZinger>|SscZingerCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'SscZingerCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.SscZingerCollection = DataRepository.SscZingerProvider.GetBySscId(transactionManager, entity.SscId);

				if (deep && entity.SscZingerCollection.Count > 0)
				{
					deepHandles.Add("SscZingerCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<SscZinger>) DataRepository.SscZingerProvider.DeepLoad,
						new object[] { transactionManager, entity.SscZingerCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region StreetTargetCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<StreetTarget>|StreetTargetCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'StreetTargetCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.StreetTargetCollection = DataRepository.StreetTargetProvider.GetBySscId(transactionManager, entity.SscId);

				if (deep && entity.StreetTargetCollection.Count > 0)
				{
					deepHandles.Add("StreetTargetCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<StreetTarget>) DataRepository.StreetTargetProvider.DeepLoad,
						new object[] { transactionManager, entity.StreetTargetCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the BesAsm.MasterData.Entities.Ssc object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">BesAsm.MasterData.Entities.Ssc instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">BesAsm.MasterData.Entities.Ssc Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		public override bool DeepSave(TransactionManager transactionManager, BesAsm.MasterData.Entities.Ssc entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			
			#region AltTraceNodeIdSource
			if (CanDeepSave(entity, "Node|AltTraceNodeIdSource", deepSaveType, innerList) 
				&& entity.AltTraceNodeIdSource != null)
			{
				DataRepository.NodeProvider.Save(transactionManager, entity.AltTraceNodeIdSource);
				entity.AltTraceNodeId = entity.AltTraceNodeIdSource.NodeId;
			}
			#endregion 
			
			#region NodeIdExSource
			if (CanDeepSave(entity, "Node|NodeIdExSource", deepSaveType, innerList) 
				&& entity.NodeIdExSource != null)
			{
				DataRepository.NodeProvider.Save(transactionManager, entity.NodeIdExSource);
				entity.NodeIdEx = entity.NodeIdExSource.NodeId;
			}
			#endregion 
			
			#region NodeIdFuSource
			if (CanDeepSave(entity, "Node|NodeIdFuSource", deepSaveType, innerList) 
				&& entity.NodeIdFuSource != null)
			{
				DataRepository.NodeProvider.Save(transactionManager, entity.NodeIdFuSource);
				entity.NodeIdFu = entity.NodeIdFuSource.NodeId;
			}
			#endregion 
			
			#region StatusSource
			if (CanDeepSave(entity, "Status|StatusSource", deepSaveType, innerList) 
				&& entity.StatusSource != null)
			{
				DataRepository.StatusProvider.Save(transactionManager, entity.StatusSource);
				entity.Status = entity.StatusSource.StatusId;
			}
			#endregion 
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
	
			#region List<IcNodeRedirector>
				if (CanDeepSave(entity.IcNodeRedirectorCollection, "List<IcNodeRedirector>|IcNodeRedirectorCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(IcNodeRedirector child in entity.IcNodeRedirectorCollection)
					{
						if(child.SscIdSource != null)
						{
							child.SscId = child.SscIdSource.SscId;
						}
						else
						{
							child.SscId = entity.SscId;
						}

					}

					if (entity.IcNodeRedirectorCollection.Count > 0 || entity.IcNodeRedirectorCollection.DeletedItems.Count > 0)
					{
						//DataRepository.IcNodeRedirectorProvider.Save(transactionManager, entity.IcNodeRedirectorCollection);
						
						deepHandles.Add("IcNodeRedirectorCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< IcNodeRedirector >) DataRepository.IcNodeRedirectorProvider.DeepSave,
							new object[] { transactionManager, entity.IcNodeRedirectorCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<SscZinger>
				if (CanDeepSave(entity.SscZingerCollection, "List<SscZinger>|SscZingerCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(SscZinger child in entity.SscZingerCollection)
					{
						if(child.SscIdSource != null)
						{
							child.SscId = child.SscIdSource.SscId;
						}
						else
						{
							child.SscId = entity.SscId;
						}

					}

					if (entity.SscZingerCollection.Count > 0 || entity.SscZingerCollection.DeletedItems.Count > 0)
					{
						//DataRepository.SscZingerProvider.Save(transactionManager, entity.SscZingerCollection);
						
						deepHandles.Add("SscZingerCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< SscZinger >) DataRepository.SscZingerProvider.DeepSave,
							new object[] { transactionManager, entity.SscZingerCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<StreetTarget>
				if (CanDeepSave(entity.StreetTargetCollection, "List<StreetTarget>|StreetTargetCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(StreetTarget child in entity.StreetTargetCollection)
					{
						if(child.SscIdSource != null)
						{
							child.SscId = child.SscIdSource.SscId;
						}
						else
						{
							child.SscId = entity.SscId;
						}

					}

					if (entity.StreetTargetCollection.Count > 0 || entity.StreetTargetCollection.DeletedItems.Count > 0)
					{
						//DataRepository.StreetTargetProvider.Save(transactionManager, entity.StreetTargetCollection);
						
						deepHandles.Add("StreetTargetCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< StreetTarget >) DataRepository.StreetTargetProvider.DeepSave,
							new object[] { transactionManager, entity.StreetTargetCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region SscChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>BesAsm.MasterData.Entities.Ssc</c>
	///</summary>
	public enum SscChildEntityTypes
	{
		
		///<summary>
		/// Composite Property for <c>Node</c> at AltTraceNodeIdSource
		///</summary>
		[ChildEntityType(typeof(Node))]
		Node,
			
		///<summary>
		/// Composite Property for <c>Status</c> at StatusSource
		///</summary>
		[ChildEntityType(typeof(Status))]
		Status,
	
		///<summary>
		/// Collection of <c>Ssc</c> as OneToMany for IcNodeRedirectorCollection
		///</summary>
		[ChildEntityType(typeof(TList<IcNodeRedirector>))]
		IcNodeRedirectorCollection,

		///<summary>
		/// Collection of <c>Ssc</c> as OneToMany for SscZingerCollection
		///</summary>
		[ChildEntityType(typeof(TList<SscZinger>))]
		SscZingerCollection,

		///<summary>
		/// Collection of <c>Ssc</c> as OneToMany for StreetTargetCollection
		///</summary>
		[ChildEntityType(typeof(TList<StreetTarget>))]
		StreetTargetCollection,
	}
	
	#endregion SscChildEntityTypes
	
	#region SscFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;SscColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Ssc"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class SscFilterBuilder : SqlFilterBuilder<SscColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the SscFilterBuilder class.
		/// </summary>
		public SscFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the SscFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public SscFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the SscFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public SscFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion SscFilterBuilder
	
	#region SscParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;SscColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Ssc"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class SscParameterBuilder : ParameterizedSqlFilterBuilder<SscColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the SscParameterBuilder class.
		/// </summary>
		public SscParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the SscParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public SscParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the SscParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public SscParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion SscParameterBuilder
	
	#region SscSortBuilder
    
    /// <summary>
    /// A strongly-typed instance of the <see cref="SqlSortBuilder&lt;SscColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Ssc"/> object.
    /// </summary>
    [CLSCompliant(true)]
    public class SscSortBuilder : SqlSortBuilder<SscColumn>
    {
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the SscSqlSortBuilder class.
		/// </summary>
		public SscSortBuilder() : base() { }

		#endregion Constructors

    }    
    #endregion SscSortBuilder
	
} // end namespace
